// Copyright 2011 Jefferson Willian
// willmont7@gmail.com

#include <cstdio>

int main() {
  int n;
  int ticket;
  int ret;
  int games = 1;

  while (scanf("%d", &n) && n != 0) {
    ret = 0;
    for (int i = 1;i <= n;i++) {
      scanf("%d", &ticket);
      if (ticket == i)
        ret = i;
    }

    printf("Teste %d\n%d\n\n", games++, ret);
  }

  return 0;
}
